package com.eoner.baselibrary.bean.goods;

import android.os.Parcel;
import android.os.Parcelable;

import com.eoner.commonbean.product.ShProductTag;

import java.util.Arrays;
import java.util.List;

/**
 * @auther hjian
 * @date 2019/12/13.
 */
public class ProductBean implements Parcelable {
    /**
     * sh_id : 381
     * sh_name : 梦多多 16秋冬新品加绒
     * sh_subname : 口感鲜咸绵软
     * sh_brand_id : 10
     * sh_stock : 15
     * sh_sold_out : 0
     * sh_in_stock : 1
     * sh_price : 30
     * sh_vip_price : 20
     * sh_promotion_price : 100
     * sh_promotion_type : 1
     * sh_promotion_start_at : 2017-06-14 12:12:12
     * sh_promotion_end_at : 2017-08-14 12:12:12
     * sh_show_price : 100
     * sh_line_price : 30
     * sh_image : http://img1.shihanbainian.com/shihan2/index/tuijianpinpai_shouye_img3.png?x-oss-process=style/750_750.jpg
     * sh_description : 宋嫂酥是地道的江南风味糕点，其色金黄诱人。热口鲜咸不油腻，绵软不粘牙
     * sh_label : {"sh_icon":"http://img1.shihanbainian.com/shihan2/icon/new_product.jpg","sh_icon_width":92,"sh_icon_height":130,"sh_location":"left_top"}
     */

    private String sh_id;
    private String sh_name;
    private String sh_subname;
    private String sh_brand_id;
    private String sh_stock;
    private String sh_sold_out;
    private String sh_in_stock;
    private String sh_is_new;
    private String sh_price;
    private String sh_vip_price;
    private String sh_promotion_price;
    private String sh_promotion_type;
    private String sh_promotion_start_at;
    private String sh_promotion_end_at;
    private String sh_show_price;
    private String sh_line_price;
    private String sh_image;
    private String sh_description;
    private String sh_product_main_id;
    private String sh_product_id;
    private String sh_partner_commission;
    private ProductBean.ShLabelBean sh_label;
    private IconInfoBean sh_icon_info;
    private String sh_image_width;
    private String sh_type;
    private String sh_integral_price;
    private String sh_seller_id;
    private String sh_event_map_id;
    private String sh_is_promotion;
    private String sh_has_video;
    private List<String> sh_child_ids;
    private String sh_sold,sh_display;
    private String sh_date;
    private String sh_country;
    private String sh_country_logo;
    private String sh_send_type;//1国内保税仓 2 海外直邮
    private String sh_promotion_name;
    private String sh_tag;
    private String sh_title;
    private ShProductTag[] sh_tags;
    private String sh_activity_flag; //1 正常 2新人专享
    private String sh_label_name;
    private String sh_new_user_promotion_price;
    private String sh_meet_reduce_name;
    //翻倍佣金
    private String sh_double_partner_commission;
    private String sh_share_url;
    //精选好店
    private String sh_shop_icon;
    private ShPriceTagBean sh_price_tag;
    private String sh_daily_price;
    private String sh_market_price;
    private boolean sh_show_vip_price;

    protected ProductBean(Parcel in) {
        sh_id = in.readString();
        sh_price_tag = in.readParcelable(Thread.currentThread().getContextClassLoader());
        Parcelable[] parcelables = in.readParcelableArray(ShProductTag.class.getClassLoader());
        if (parcelables != null) {
            sh_tags = Arrays.copyOf(parcelables, parcelables.length, ShProductTag[].class);
        }
        sh_name = in.readString();
        sh_subname = in.readString();
        sh_brand_id = in.readString();
        sh_stock = in.readString();
        sh_sold_out = in.readString();
        sh_in_stock = in.readString();
        sh_is_new = in.readString();
        sh_price = in.readString();
        sh_vip_price = in.readString();
        sh_promotion_price = in.readString();
        sh_promotion_type = in.readString();
        sh_promotion_start_at = in.readString();
        sh_promotion_end_at = in.readString();
        sh_show_price = in.readString();
        sh_line_price = in.readString();
        sh_image = in.readString();
        sh_description = in.readString();
        sh_product_main_id = in.readString();
        sh_product_id = in.readString();
        sh_partner_commission = in.readString();
        sh_image_width = in.readString();
        sh_type = in.readString();
        sh_integral_price = in.readString();
        sh_seller_id = in.readString();
        sh_event_map_id = in.readString();
        sh_is_promotion = in.readString();
        sh_has_video = in.readString();
        sh_child_ids = in.createStringArrayList();
        sh_sold = in.readString();
        sh_display = in.readString();
        sh_date = in.readString();
        sh_country = in.readString();
        sh_country_logo = in.readString();
        sh_send_type = in.readString();
        sh_promotion_name = in.readString();
        sh_tag = in.readString();
        sh_title = in.readString();
        sh_activity_flag = in.readString();
        sh_label_name = in.readString();
        sh_new_user_promotion_price = in.readString();
        sh_meet_reduce_name = in.readString();
        sh_double_partner_commission = in.readString();
        sh_share_url = in.readString();
        sh_shop_icon = in.readString();
        sh_daily_price = in.readString();
        sh_market_price = in.readString();
        sh_show_vip_price = in.readByte() != 0;
    }

    public static final Creator<ProductBean> CREATOR = new Creator<ProductBean>() {
        @Override
        public ProductBean createFromParcel(Parcel in) {
            return new ProductBean(in);
        }

        @Override
        public ProductBean[] newArray(int size) {
            return new ProductBean[size];
        }
    };

    public List<ShProductTag> getTags() {
        return Arrays.asList(sh_tags);
    }

    public void setTags(List<ShProductTag> sh_tags) {
        this.sh_tags = sh_tags.toArray(new ShProductTag[0]);
    }

    public boolean isSh_show_vip_price() {
        return sh_show_vip_price;
    }

    public void setSh_show_vip_price(boolean sh_show_vip_price) {
        this.sh_show_vip_price = sh_show_vip_price;
    }

    public String getSh_image_width() {
        return sh_image_width;
    }

    public void setSh_image_width(String sh_image_width) {
        this.sh_image_width = sh_image_width;
    }

    public IconInfoBean getSh_icon_info() {
        return sh_icon_info;
    }

    public void setSh_icon_info(IconInfoBean sh_icon_info) {
        this.sh_icon_info = sh_icon_info;
    }


    public String getSh_market_price() {
        return sh_market_price;
    }

    public void setSh_market_price(String sh_market_price) {
        this.sh_market_price = sh_market_price;
    }

    public String getSh_daily_price() {
        return sh_daily_price;
    }

    public void setSh_daily_price(String sh_daily_price) {
        this.sh_daily_price = sh_daily_price;
    }


    public ShPriceTagBean getPriceTagBean() {
        return sh_price_tag;
    }

    public void setPriceTagBean(ShPriceTagBean sh_price_tag) {
        this.sh_price_tag = sh_price_tag;
    }

    public String getSh_shop_icon() {
        return sh_shop_icon;
    }

    public void setSh_shop_icon(String sh_shop_icon) {
        this.sh_shop_icon = sh_shop_icon;
    }

    public String getSh_double_partner_commission() {
        return sh_double_partner_commission;
    }

    public void setSh_double_partner_commission(String sh_double_partner_commission) {
        this.sh_double_partner_commission = sh_double_partner_commission;
    }

    public String getSh_share_url() {
        return sh_share_url;
    }

    public void setSh_share_url(String sh_share_url) {
        this.sh_share_url = sh_share_url;
    }

    public String getSh_activity_flag() {
        return sh_activity_flag;
    }

    public void setSh_activity_flag(String sh_activity_flag) {
        this.sh_activity_flag = sh_activity_flag;
    }

    public String getSh_meet_reduce_name() {
        return sh_meet_reduce_name;
    }

    public void setSh_meet_reduce_name(String sh_meet_reduce_name) {
        this.sh_meet_reduce_name = sh_meet_reduce_name;
    }

    public String getSh_label_name() {
        return sh_label_name;
    }

    public void setSh_label_name(String sh_label_name) {
        this.sh_label_name = sh_label_name;
    }

    public String getSh_new_user_promotion_price() {
        return sh_new_user_promotion_price;
    }

    public void setSh_new_user_promotion_price(String sh_new_user_promotion_price) {
        this.sh_new_user_promotion_price = sh_new_user_promotion_price;
    }

    public String getSh_country() {
        return sh_country;
    }

    public void setSh_country(String sh_country) {
        this.sh_country = sh_country;
    }

    public String getSh_country_logo() {
        return sh_country_logo;
    }

    public void setSh_country_logo(String sh_country_logo) {
        this.sh_country_logo = sh_country_logo;
    }

    public String getSh_send_type() {
        return sh_send_type;
    }

    public void setSh_send_type(String sh_send_type) {
        this.sh_send_type = sh_send_type;
    }

    public String getSh_promotion_name() {
        return sh_promotion_name;
    }

    public void setSh_promotion_name(String sh_promotion_name) {
        this.sh_promotion_name = sh_promotion_name;
    }

    public String getSh_tag() {
        return sh_tag;
    }

    public void setSh_tag(String sh_tag) {
        this.sh_tag = sh_tag;
    }

    public String getSh_title() {
        return sh_title;
    }

    public void setSh_title(String sh_title) {
        this.sh_title = sh_title;
    }

    public String getSh_sold() {
        return sh_sold;
    }

    public void setSh_sold(String sh_sold) {
        this.sh_sold = sh_sold;
    }

    public String getSh_display() {
        return sh_display;
    }

    public void setSh_display(String sh_display) {
        this.sh_display = sh_display;
    }

    public String getSh_date() {
        return sh_date;
    }

    public void setSh_date(String sh_date) {
        this.sh_date = sh_date;
    }

    public String getSh_type() {
        return sh_type;
    }

    public void setSh_type(String sh_type) {
        this.sh_type = sh_type;
    }

    public String getSh_integral_price() {
        return sh_integral_price;
    }

    public void setSh_integral_price(String sh_integral_price) {
        this.sh_integral_price = sh_integral_price;
    }

    public String getSh_seller_id() {
        return sh_seller_id;
    }

    public void setSh_seller_id(String sh_seller_id) {
        this.sh_seller_id = sh_seller_id;
    }

    public String getSh_event_map_id() {
        return sh_event_map_id;
    }

    public void setSh_event_map_id(String sh_event_map_id) {
        this.sh_event_map_id = sh_event_map_id;
    }

    public String getSh_is_promotion() {
        return sh_is_promotion;
    }

    public void setSh_is_promotion(String sh_is_promotion) {
        this.sh_is_promotion = sh_is_promotion;
    }

    public String getSh_has_video() {
        return sh_has_video;
    }

    public void setSh_has_video(String sh_has_video) {
        this.sh_has_video = sh_has_video;
    }

    public List<String> getSh_child_ids() {
        return sh_child_ids;
    }

    public void setSh_child_ids(List<String> sh_child_ids) {
        this.sh_child_ids = sh_child_ids;
    }

    public String getSh_partner_commission() {
        return sh_partner_commission;
    }

    public void setSh_partner_commission(String sh_partner_commission) {
        this.sh_partner_commission = sh_partner_commission;
    }

    public String getSh_is_new() {
        return sh_is_new;
    }

    public void setSh_is_new(String sh_is_new) {
        this.sh_is_new = sh_is_new;
    }

    public String getSh_id() {
        return sh_id;
    }

    public void setSh_id(String sh_id) {
        this.sh_id = sh_id;
    }

    public String getSh_name() {
        return sh_name;
    }

    public void setSh_name(String sh_name) {
        this.sh_name = sh_name;
    }

    public String getSh_subname() {
        return sh_subname;
    }

    public void setSh_subname(String sh_subname) {
        this.sh_subname = sh_subname;
    }

    public String getSh_brand_id() {
        return sh_brand_id;
    }

    public void setSh_brand_id(String sh_brand_id) {
        this.sh_brand_id = sh_brand_id;
    }

    public String getSh_stock() {
        return sh_stock;
    }

    public void setSh_stock(String sh_stock) {
        this.sh_stock = sh_stock;
    }

    public String getSh_sold_out() {
        return sh_sold_out;
    }

    public void setSh_sold_out(String sh_sold_out) {
        this.sh_sold_out = sh_sold_out;
    }

    public String getSh_in_stock() {
        return sh_in_stock;
    }

    public void setSh_in_stock(String sh_in_stock) {
        this.sh_in_stock = sh_in_stock;
    }

    public String getSh_price() {
        return sh_price;
    }

    public void setSh_price(String sh_price) {
        this.sh_price = sh_price;
    }

    public String getSh_vip_price() {
        return sh_vip_price;
    }

    public void setSh_vip_price(String sh_vip_price) {
        this.sh_vip_price = sh_vip_price;
    }

    public String getSh_promotion_price() {
        return sh_promotion_price;
    }

    public void setSh_promotion_price(String sh_promotion_price) {
        this.sh_promotion_price = sh_promotion_price;
    }

    public String getSh_promotion_type() {
        return sh_promotion_type;
    }

    public void setSh_promotion_type(String sh_promotion_type) {
        this.sh_promotion_type = sh_promotion_type;
    }

    public String getSh_promotion_start_at() {
        return sh_promotion_start_at;
    }

    public void setSh_promotion_start_at(String sh_promotion_start_at) {
        this.sh_promotion_start_at = sh_promotion_start_at;
    }

    public String getSh_promotion_end_at() {
        return sh_promotion_end_at;
    }

    public void setSh_promotion_end_at(String sh_promotion_end_at) {
        this.sh_promotion_end_at = sh_promotion_end_at;
    }

    public String getSh_show_price() {
        return sh_show_price;
    }

    public void setSh_show_price(String sh_show_price) {
        this.sh_show_price = sh_show_price;
    }

    public String getSh_line_price() {
        return sh_line_price;
    }

    public void setSh_line_price(String sh_line_price) {
        this.sh_line_price = sh_line_price;
    }

    public String getSh_image() {
        return sh_image;
    }

    public void setSh_image(String sh_image) {
        this.sh_image = sh_image;
    }

    public String getSh_description() {
        return sh_description;
    }

    public void setSh_description(String sh_description) {
        this.sh_description = sh_description;
    }

    public ProductBean.ShLabelBean getSh_label() {
        return sh_label;
    }

    public void setSh_label(ProductBean.ShLabelBean sh_label) {
        this.sh_label = sh_label;
    }

    public String getSh_product_main_id() {
        return sh_product_main_id;
    }

    public void setSh_product_main_id(String sh_product_main_id) {
        this.sh_product_main_id = sh_product_main_id;
    }

    public String getSh_product_id() {
        return sh_product_id;
    }

    public void setSh_product_id(String sh_product_id) {
        this.sh_product_id = sh_product_id;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(sh_id);
        dest.writeParcelable(sh_price_tag,0);
        dest.writeParcelableArray(sh_tags,0);
        dest.writeString(sh_name);
        dest.writeString(sh_subname);
        dest.writeString(sh_brand_id);
        dest.writeString(sh_stock);
        dest.writeString(sh_sold_out);
        dest.writeString(sh_in_stock);
        dest.writeString(sh_is_new);
        dest.writeString(sh_price);
        dest.writeString(sh_vip_price);
        dest.writeString(sh_promotion_price);
        dest.writeString(sh_promotion_type);
        dest.writeString(sh_promotion_start_at);
        dest.writeString(sh_promotion_end_at);
        dest.writeString(sh_show_price);
        dest.writeString(sh_line_price);
        dest.writeString(sh_image);
        dest.writeString(sh_description);
        dest.writeString(sh_product_main_id);
        dest.writeString(sh_product_id);
        dest.writeString(sh_partner_commission);
        dest.writeString(sh_image_width);
        dest.writeString(sh_type);
        dest.writeString(sh_integral_price);
        dest.writeString(sh_seller_id);
        dest.writeString(sh_event_map_id);
        dest.writeString(sh_is_promotion);
        dest.writeString(sh_has_video);
        dest.writeStringList(sh_child_ids);
        dest.writeString(sh_sold);
        dest.writeString(sh_display);
        dest.writeString(sh_date);
        dest.writeString(sh_country);
        dest.writeString(sh_country_logo);
        dest.writeString(sh_send_type);
        dest.writeString(sh_promotion_name);
        dest.writeString(sh_tag);
        dest.writeString(sh_title);
        dest.writeString(sh_activity_flag);
        dest.writeString(sh_label_name);
        dest.writeString(sh_new_user_promotion_price);
        dest.writeString(sh_meet_reduce_name);
        dest.writeString(sh_double_partner_commission);
        dest.writeString(sh_share_url);
        dest.writeString(sh_shop_icon);
        dest.writeString(sh_daily_price);
        dest.writeString(sh_market_price);
        dest.writeByte(this.sh_show_vip_price ? (byte) 1 : (byte) 0);
    }

    public static class ShLabelBean {
        /**
         * sh_icon : http://img1.shihanbainian.com/shihan2/icon/new_product.jpg
         * sh_icon_width : 92
         * sh_icon_height : 130
         * sh_location : left_top
         */

        private String sh_icon;
        private String sh_icon_width;
        private String sh_icon_height;
        private String sh_location;

        public String getSh_icon() {
            return sh_icon;
        }

        public void setSh_icon(String sh_icon) {
            this.sh_icon = sh_icon;
        }

        public String getSh_icon_width() {
            return sh_icon_width;
        }

        public void setSh_icon_width(String sh_icon_width) {
            this.sh_icon_width = sh_icon_width;
        }

        public String getSh_icon_height() {
            return sh_icon_height;
        }

        public void setSh_icon_height(String sh_icon_height) {
            this.sh_icon_height = sh_icon_height;
        }

        public String getSh_location() {
            return sh_location;
        }

        public void setSh_location(String sh_location) {
            this.sh_location = sh_location;
        }
    }
}
